/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AdminUIPanel.java
 *
 * Created on 05/09/2011, 12:58:44 PM
 */
package Interface;

import java.awt.event.ActionEvent;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JSpinner;

/**
 *
 * @author Michael Peever & Alex Pool
 */
public class AdminUI extends JFrame {
    
    String region;
    String liftColour;
    String liftShaftColour;

    /** Creates new form AdminUIPanel */
    public AdminUI() {
        initComponents();
        this.setLocation(0, 0);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }

    public int getNoFloors() {
        return Integer.parseInt(noFloorsSpinner.getValue().toString());
    }

    public int getNoLifts() {
        return Integer.parseInt(noLiftsSpinner.getValue().toString());
    }
    
    
    public String getRegion(){
        region = (String)regionBox1.getSelectedItem();
        return region; 
    }
    
    public String getLiftColour(){
        liftColour = (String)liftColourBox.getSelectedItem();
        return liftColour;
    }
     public String getLiftShaftColour(){
        liftShaftColour = (String)liftShaftColourBox.getSelectedItem();
        return liftShaftColour;
    }
    
    

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        noFloorsLbl = new javax.swing.JLabel();
        noLiftsLbl = new javax.swing.JLabel();
        applyButton = new javax.swing.JButton();
        noLiftsSpinner = new javax.swing.JSpinner();
        noFloorsSpinner = new javax.swing.JSpinner();
        noFloorsLbl1 = new javax.swing.JLabel();
        regionBox1 = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        liftColourBox = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        liftShaftColourBox = new javax.swing.JComboBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Administration Interface");
        setName("AdminUI"); // NOI18N

        noFloorsLbl.setText("No. of Floors:");

        noLiftsLbl.setText("No. of Lifts:");

        applyButton.setText("Apply");

        noLiftsSpinner.setModel(new javax.swing.SpinnerNumberModel(1, 1, 3, 1));

        noFloorsSpinner.setModel(new javax.swing.SpinnerNumberModel(2, 1, 10, 1));

        noFloorsLbl1.setText("Region:");

        regionBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "AUS/UK", "USA" }));
        regionBox1.setSelectedItem("AUS/UK");

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel1.setText("Colour Scheme");

        jLabel2.setText("Lift Colour");

        liftColourBox.setSelectedItem("Black");
        liftColourBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Black", "Blue", "Pink" }));
        liftColourBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                liftColourBoxActionPerformed(evt);
            }
        });

        jLabel3.setText("Lift Shaft Colour");

        liftShaftColourBox.setSelectedItem("Orange");
        liftShaftColourBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Orange", "Purple", "Yellow" }));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(noFloorsLbl, javax.swing.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(noLiftsLbl)
                                .addGap(86, 86, 86)))
                        .addGap(5, 5, 5)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(noFloorsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(noLiftsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(noFloorsLbl1, javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE)
                        .addGap(1, 1, 1)
                        .addComponent(regionBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(applyButton, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel1)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 146, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(liftColourBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(liftShaftColourBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(noLiftsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(noFloorsSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(noLiftsLbl)
                        .addGap(18, 18, 18)
                        .addComponent(noFloorsLbl)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(noFloorsLbl1)
                    .addComponent(regionBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(liftColourBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(liftShaftColourBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
                .addComponent(applyButton)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void liftColourBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_liftColourBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_liftColourBoxActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(AdminUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(AdminUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(AdminUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(AdminUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new AdminUI().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton applyButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JComboBox liftColourBox;
    private javax.swing.JComboBox liftShaftColourBox;
    private javax.swing.JLabel noFloorsLbl;
    private javax.swing.JLabel noFloorsLbl1;
    private javax.swing.JSpinner noFloorsSpinner;
    private javax.swing.JLabel noLiftsLbl;
    private javax.swing.JSpinner noLiftsSpinner;
    private javax.swing.JComboBox regionBox1;
    // End of variables declaration//GEN-END:variables
}
